package cn.dsp.admin.config;


import cn.dsp.admin.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class LoginInterceptorConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        HandlerInterceptor interceptor = new LoginInterceptor();

      /*  List<String> paths = new ArrayList<>();
        paths.add("/js/**");
        paths.add("/css/**");
        paths.add("/images/**");
        paths.add("/bootstrap3/**");


        paths.add("/web/reg.html");
        paths.add("/web/login.html");


        paths.add("/admin/reg");
        paths.add("/admin/login");

        paths.add("/districts/**");
        paths.add("/products/**");


        registry.addInterceptor(interceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(paths);*/
    }
}
